PROGRAM calendar;

VAR year,month,days: INTEGER;

PROCEDURE howManyDays(y,m:INTEGER;VAR d:INTEGER);
BEGIN	
	CASE m of
		1,3,5,7,8,10,12: d:=31;
		4,6,9,11:d:=30;
		2: IF y MOD 4 = 0 THEN d:=29
		   ELSE d:=28
	END;
END;

BEGIN
	write('Input year:');
	readln(year);
	write('Input month:');
	readln(month);
	
	howManyDays(year,month,days);
	write('Days is ',days);

END.
